package bavaria.hightech.banking.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;

/**
 * ActionListener for the "Transfer" command from the menu. Loads the
 * transferJPanel into the contentWrapper Panel.
 * 
 * @author Dietmar
 */
public class ListenerTransfer implements ActionListener {

	private GlobalVarsContainer cont;

	public ListenerTransfer(GlobalVarsContainer cont) {
		this.cont = cont;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		PanelTransfer transfer = new PanelTransfer(cont);
		JPanel transferJPanel = transfer.getJPanel();
		cont.getContentWrapper().removeAll();
		cont.getContentWrapper().add(transferJPanel, BorderLayout.CENTER);
		cont.getContentWrapper().validate();
	}

}
